﻿using AbstractFactoryPatten.Factory;
using Design.Common.Attri;
using Design.Common.Interface;
using Design.Common.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace AbstractFactoryPatten
{
    [Design(nameof(AbstractFactoryDemo), DesignType.Creation,(int)CreationType.AbstractFactory)]
    public class AbstractFactoryDemo: IDesignDemo
    {
        public DesignAttribute GetDesignAttribute() => typeof(AbstractFactoryDemo).GetCustomAttribute<DesignAttribute>();

        public void RunExample(bool isRun)
        {
            if (!isRun) return;
            new AUDICreator().CreateCarProduct();
            new AUDICreator().CreatePhoneProduct();
            new BYDCreator().CreateCarProduct();
            new BYDCreator().CreatePhoneProduct();
        }
    }
}
